package com.huitong.common.core.constant;

import lombok.AccessLevel;
import lombok.NoArgsConstructor;

/**
 * 参数校验信息常量
 *
 * @author fromdrowning
 * @date 2024/4/30 下午7:11
 */
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public class ValidateConstant {

    /**
     * 用户学号长度
     */
    public static final int USER_ID_LENGTH = 12;

    /**
     * 用户名最小长度
     */
    public static final int USER_NAME_MIN_LENGTH = 2;

    /**
     * 用户名最大长度
     */
    public static final int USER_NAME_MAX_LENGTH = 25;

    /**
     * 学院号长度
     */
    public static final int COLLEGE_ID_LENGTH = 4;

    /**
     * 学院名最小长度
     */
    public static final int COLLEGE_NAME_MIN_LENGTH = 2;

    /**
     * 学院名最大长度
     */
    public static final int COLLEGE_NAME_MAX_LENGTH = 30;

    /**
     * 专业号长度
     */
    public static final int MAJOR_ID_LENGTH = 5;

    /**
     * 专业名最小长度
     */
    public static final int MAJOR_NAME_MIN_LENGTH = 2;

    /**
     * 专业名最大长度
     */
    public static final int MAJOR_NAME_MAX_LENGTH = 30;

    /**
     * 班级号长度
     */
    public static final int CLASS_ID_LENGTH = 6;

    /**
     * 班级名最小长度
     */
    public static final int CLASS_NAME_MIN_LENGTH = 2;

    /**
     * 班级名最大长度
     */
    public static final int CLASS_NAME_MAX_LENGTH = 30;

    /**
     * 密码正则
     */
    public static final String PASSWORD_REGEX = "^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d)[a-zA-Z\\d]{8,}$";

    /**
     * 角色正则
     */
    public static final String ROLE_REGEX = "^(" + UserConstant.STUDENT + "|" + UserConstant.ADMIN + "|" + UserConstant.TEACHER + ")$";

    /**
     * 角色正则 排除管理员
     */
    public static final String ROLE_NO_ADMIN_REGEX = "^(" + UserConstant.STUDENT + "|" + UserConstant.TEACHER + ")$";

    /**
     * 排序规则正则
     */
    public static final String ORDER_RULE_REGEX = "^(asc|desc)$";

    /**
     * 手机号正则
     */
    public static final String PHONE_REGEX = "^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\\d{8}$";

    /**
     * 身份证号正则
     */
    public static final String CARD_REGEX = "^([1-6][1-9]|50)\\d{4}(18|19|20)\\d{2}((0[1-9])|10|11|12)(([0-2][1-9])|10|20|30|31)\\d{3}[0-9Xx]$";

    /**
     * .jpg文件后缀
     */
    public static final String JPG_SUFFIX = ".jpg";

    /**
     * .jpeg文件后缀
     */
    public static final String JPEG_SUFFIX = ".jpeg";

    /**
     * .xls文件后缀
     */
    public static final String XLS_SUFFIX = ".xls";

    /**
     * .xlsx文件后缀
     */
    public static final String XLSX_SUFFIX = ".xlsx";

}
